import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import "./assets/style/index.scss";
import "./assets/style/form.scss";
import "./assets/style/style.css";
import ElementPlus from "element-plus";
import "./assets/style/page-initialize.css";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import zhCn from "element-plus/lib/locale/lang/zh-cn";
// 地图组件
//引入cesium基础库
import "mars3d-cesium/Build/Cesium/Widgets/widgets.css";
import * as Cesium from "mars3d-cesium";
import "mars3d/dist/mars3d.css";

import "./nprogress";
import "./utils/rem.js";
const app = createApp(App);
// 页面title
import pagetitle from "./components/pagetitle.vue";
app.component("pagetitle", pagetitle);

// 页面图片
import image from "./components/image.vue";
app.component("images", image);
// 页面温馨提示
import kindreminder from "./components/kindreminder.vue";
app.component("kindreminder", kindreminder);
// 页面表单
import pageform from "./components/pageform.vue";
app.component("pageform", pageform);
// 页面表格
import pagetable from "./components/pagetable.vue";
app.component("pagetable", pagetable);
// 分页
import pagination from "./components/pagination.vue";
app.component("pagination", pagination);
// 地址四级联动
import addRess from "./components/selectAddress.vue";
app.component("addRess", addRess);
// 上传文件
import uploadFile from "./components/uploadfile.vue";
app.component("uploadFile", uploadFile);
// 三峡农夫按钮
import sxnfbtn from "./components/sxnfbtn.vue";
app.component("sxnfbtn", sxnfbtn);

// 单选按钮组
import radiobutton from "./components/radiobutton.vue";
app.component("radiobutton", radiobutton);
// 注册所有图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
}
//引入VueWechatTitle
const VueWechatTitle = require("vue-wechat-title");
// console.log(Table);
// // 解决 ElTable 自动宽度高度导致的「ResizeObserver loop limit exceeded」问题
// const fixElTableErr = (table) => {
//     const oldResizeListener = table.methods.resizeListener;
//     table.methods.resizeListener = function () {
//         window.requestAnimationFrame(oldResizeListener.bind(this));
//     };
// };
// // 一定要在Vue.use之前执行此函数
// fixElTableErr(Table);

app.use(store).use(router).use(ElementPlus, { locale: zhCn }).use(VueWechatTitle).mount("#app");
